//
//  VMCIndexApi.m
//  vmcshop
//
//  Created by toggle on 15/6/26.
//  Copyright (c) 2015年 idongler. All rights reserved.
//

#import "VMCIndexApi.h"
#import "ApiRequest.h"

@implementation VMCIndexApi
+(instancetype) sharedInstance
{
	static VMCIndexApi *instance;
	static dispatch_once_t onceToken;
	dispatch_once(&onceToken, ^{
		instance = [[self alloc]init];
	});
	return instance;
}

-(void)postWithMemberId:(NSString *)ID withMethodName:(NSString *)method callback:(API_CALLBACK)callback
{
	ApiRequest *request = [ApiRequest requestWithBizData:@{@"id":EMPTY_IF_NIL(ID)}];
	[self postApi:method andRequest:request callback:callback];

}
/**
 *  通用接口
 *
 *  @param dic      参数字典
 *  @param method   方法名
 *  @param callback 回调
 */
-(void)postGeneralWithDictionary:(NSDictionary *)dic withMethodName:(NSString *)method callback:(API_CALLBACK)callback
{
	ApiRequest *request = [ApiRequest requestWithBizData:dic];
	[self postApi:method andRequest:request callback:callback];
}

-(void)loadDoctorWithQueryParam:(VMCListQueryParam *)queryParam callback:(API_CALLBACK)callback{
	ApiRequest *request = [ApiRequest requestWithBizData:[queryParam asDict]];
	[self postApi:@"emc_member/coupon_list" andRequest:request callback:callback];

}

@end
